function IGrids=getInputGrids(obj)

% This file is part of CISNE.
%
%     CISNE is free software: you can redistribute it and/or modify
%     it under the terms of the GNU General Public License as published by
%     the Free Software Foundation, either version 3 of the License, or
%     any later version.
%
%     CISNE is distributed in the hope that it will be useful,
%     but WITHOUT ANY WARRANTY; without even the implied warranty of
%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%     GNU General Public License for more details.
%
%     You should have received a copy of the GNU General Public License
%     along with CISNE.  If not, see <http://www.gnu.org/licenses/>.

% Copyright 2011. Jose Maria Garcia-Valdecasas Bernal

node=[];
root=obj.m_tree.Root();
for j=0:get(root,'ChildCount')-1
    child=root.getChildAt(j);
    kind=child.getValue();
    kind=char(kind(2));
    if (strcmp(kind,'INPUT'))
        %CGrids found, return child
        node=child;
        break
    end
end

if get(node,'ChildCount')==0
    IGrids=[];
else
    for j=0:get(node,'ChildCount')-1
        child=node.getChildAt(j);
        name=child.getValue();
        name=char(name(2));
        IGrids.(name).X0=obj.getValue('Xmin',name);
        IGrids.(name).Y0=obj.getValue('Ymin',name);
        IGrids.(name).DX=obj.getValue('X Step',name);
        IGrids.(name).DY=obj.getValue('Y Step',name);
        IGrids.(name).NX=obj.getValue('Nx',name);
        IGrids.(name).NY=obj.getValue('Ny',name);
        if obj.getValue('Swap',name)
            IGrids.(name).Swap=1;
        else
            IGrids.(name).Swap=-1;
        end
        IGrids.(name).File=char(obj.getValue('File',name));
        IGrids.(name).Filetype=obj.getValue('filetype',name);
        IGrids.(name).Angle=obj.getValue('Angle',name);
        IGrids.(name).Header=obj.getValue('Header',name);
    end
end
end


